import {createStore} from "vuex"

//dispatch
const actions={//context value

}

//commit
const mutations = {//state value
    musicKey(state,value){
        state.musicKey = value;
    },
    musicId(state, value) {
        console.log('已接受处理')
        state.musicId = value.split('\n');
    },
    initMusic(state){
        state.musicId = state.musicInit;
    }
}

//$store.state
const state={
    musicId:[],
    musicInit:[
        "1937050851",
        "31445554",
        "1336856449",
        "1953828422",
        "1899042430",
        "1848375872",
        "1824065339",
        "1365914380",
        "85571",
        "66282",
        "386844",
        "30431376",
        "26830207",
        "1943043408",
        "1902819385",
        "157288",
        "1413863166",
        "1413142894",
        "1336866429",
        "497572729",
        "496869422",
        "421423806",
        "31445772",
        "30431367",
        "1833391733",
        "1942366869",
    ],
    master:"阿新",
    masterTime:"2022",
    musicKey:true
}

export default createStore({
    actions,
    mutations,
    state
})
